	<?php 
		$ci= &get_instance();
		$tournament_id = $_GET['t_id'];
		$listPrize = $ci->week_prize_entity->getArrayListOfPrizeCategories($tournament_id);
		$TOURNAMENT = $this->tournament_entity->init('id', $tournament_id);
	?>
	
	<?php $this->load->view('admin/partials/tournament_menu'); ?>
	<div class="clrboth"></div>
	<h3>Tournament &raquo; <?php echo ucfirst($TOURNAMENT->getName());?></h3>
	<?php $buttons = array('buttons'=>array("Add#add_new_category($tournament_id);") );?>
	<?php $this->load->view('admin/partials/buttons', $buttons ); ?>
	
<table>	
	<thead>
		<th>Title</th>
		<th>StartTime</th>
		<th>EndTime</th>
		<th>Enable</th>
		<th>Status</th>
		<th>Manage</th>
	</thead>
	<div class="clrboth"></div>
	<tbody>
		<?php foreach( $listPrize as $item ): ?>
			<tr>	
				<td>
					<a href="javascript:void(0);" onclick="return openPrizeManage(<?php echo $item->id?>);">	
						<?php echo $item->title;?>
					</a>
					<?php echo loader_image("id=\"loader_image_title_{$item->id}\" class=\"hidden\"");?>
				</td>
				<td><?php echo sysDateTimeFormat($item->starttime,DATE_FM);?></td>
				<td><?php echo sysDateTimeFormat($item->endtime,DATE_FM);?></td>
				<td>
					<?php if($item->status == 'Living'):?>
						<a href="javascript:void(0);" onclick="return changeEnablePrizeCate(<?php echo $item->id?>);">
							<?php echo $item->enable;?>
						</a>	
						<?php echo loader_image("id=\"loader_image_enable_{$item->id}\" class=\"hidden\"");?>
					<?php endif;?>
				</td>
				<td><?php echo $item->status;?></td>
				<td>
					<a href="javascript:void(0);" onclick="return editCategory(<?php echo $item->id?>,<?php echo $item->tournament_id;?>);">
						Edit
					</a>	
					
					<?php if($item->status == 'Living' || $item->status == 'Closed'):?>
						| &nbsp;
						<a href="javascript:void(0);" title="Finish weekly prize will save user's ranks weekly and send email to users won about their Rank and Prize." onclick="return finishWeeklyPrize(<?php echo $item->id?>);">
							Finish
						</a>			
					<?php endif; ?>
					
					<?php echo loader_image("id=\"loader_image_manage_{$item->id}\" class=\"hidden\"");?>
				</td>
				<div class="clrboth"></div>
			</tr>		
		<?php endforeach; ?>
	</tbody>
</table>		

